unit uCommitAmp;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Input1, DB, ADODB, ImgList, ComCtrls, ToolWin, Buttons, ExtCtrls,
  DBCtrls, KDBEdit, StdCtrls, Mask, KDateTime, KDBDateTime,KLookup;

type
  TfrmCommitAmp = class(TfrmInput1)
    KDBDateTime1: TKDBDateTime;
    KDBEdit1: TKDBEdit;
    KDBEdit2: TKDBEdit;
    KDBEdit3: TKDBEdit;
    qMasterCommitteeAID: TWideStringField;
    qMasterCommitDateA: TDateTimeField;
    qMasterCommitteeA: TWideStringField;
    qMasterAmpID: TWideStringField;
    qMasterProvID: TWideStringField;
    qMasterluAmpID: TWideStringField;
    procedure qMasterBeforePost(DataSet: TDataSet);
    procedure KDBEdit2BeforeLookUp(Sender: TObject; var Accept: Boolean);
  private
  protected
    function GetParamValue: String; override;
    function ListRefreshData: TCustomKLookUp; override;
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmCommitAmp: TfrmCommitAmp;

implementation

uses
  uDataModule, Utils;

{$R *.dfm}

{ TfrmCommitAmp }

function TfrmCommitAmp.GetParamValue: String;
begin
     Result := DataModule1.qCommitAmpCommitteeAID.AsString;
end;

function TfrmCommitAmp.ListRefreshData: TCustomKLookUp;
begin
     Result := DataModule1.ListAmpCommit;
end;

procedure TfrmCommitAmp.qMasterBeforePost(DataSet: TDataSet);
begin
  inherited;
    qMasterCommitteeAID.AsString := qMasterCommitteeA.AsString + qMasterAmpID.AsString;
    qMasterProvID.AsString := ValProince;
end;

procedure TfrmCommitAmp.KDBEdit2BeforeLookUp(Sender: TObject;
  var Accept: Boolean);
begin
  inherited;
     DataModule1.luREg.FixedWhere := '(PROVID = '''+ ValProince +''')';
end;

end.
